#pragma once
#include <atomic>	
#include <memory>

#include "Any.h"
#include "Task.h"
#include "semaphore.h"


class Task;
class Result
{
public:
	Result(std::shared_ptr<Task> task, bool isVaild = true);
	~Result() = default;

	void setVal(Any any);

	Any get();
private:
	Any _any;
	Semaphore _sem;
	std::shared_ptr<Task> _task;
	std::atomic_bool _isVaild;
};
